using System;
using System.Diagnostics.Contracts;

namespace Beaker.Services.FileSystem.Zip
{
	internal abstract class ZipFSEntry
		: IFileSystemEntry
	{
		private readonly string _entryName;
		private readonly IFolder _parent;

		protected ZipFSEntry( IFolder parent, string entryName )
		{
			Contract.Requires<ArgumentNullException>( !string.IsNullOrEmpty( entryName ) );

			_parent = parent;
			_entryName = entryName;
		}

		/// <summary>
		/// Gets the name of the entry
		/// </summary>
		public string Name { get { return _entryName; } }

		/// <summary>
		/// Get the folder this entry is in
		/// </summary>
		public IFolder ParentFolder { get { return _parent; } }
	}
}